package com.kotlin.lib.clazz

private open class Shape {
    open val count = 4
    open fun draw() {}

    fun fill() {}
}

private class Circle : Shape() {
    override var count: Int = 5//var覆盖val。反之不行

    final override fun draw() {
        println("circle draw")
    }
}

private class RectangleShape : Shape() {
    override val count: Int = 6
    override fun draw() {
        super.draw()
        println(::draw.name)
    }

}


private interface ShapeInterface {
    var vertexCount: Int
}
//override 关键字作为属性声明的一部分。
private class CircleShape(override var vertexCount: Int) : ShapeInterface

private class RectangleShapeInterface : ShapeInterface {
    override var vertexCount: Int = 5
}